home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / BUSINESS / STATA3.LZH / OURDATA.TUT < prev    next >
Text File  |  1988-08-30  |  7KB  |  210 lines

  1. set output error
  2. set display page 23
  3. set more 1
  4. #delimit ;
  5.  
  6. di _n(23) in wh
  7. "  ___  ____  ____  ____  ____ tm" _n
  8. " /__    /   ____/   /   ____/" _n
  9. "___/   /   /___/   /   /___/    Data sets provided by C.R.C." _n
  10. "------------------------------------------------------------"
  11. _n(2) ;
  12.  
  13. #delimit cr
  14. mac def path
  15. capture run nullfile.tut
  16. if _rc {
  17.     mac def path "\stata\"
  18.     capture run %path`nullfile.tut
  19.     if _rc {
  20.         mac def path "/usr/stata/"
  21.         capture run %path`nullfile.tut
  22.         if _rc {
  23.             #delimit ;
  24.             di in red
  25. "I cannot find the other tutorial files.  I have looked in the current" _n
  26. "directory and in \stata (DOS) or /usr/stata (Unix).  Is Stata installed" _n
  27. "correctly?" _n(2)
  28. "In any case, I cannot run the tutorial." ;
  29.             #delimit cr
  30.             exit
  31.         }
  32.     }
  33. }
  34. macro define F5 "do %path`contents.tut;"
  35. macro define F6 "do %path`ourdata.tut;"
  36. #delimit ;
  37.  
  38. di in gr
  39. "Whether you have the demonstration system or the full package, we provide "
  40. "seven" _n
  41. "data sets to get you started.  They are:" _n(2)
  42. _col(9) "Name of data set" _col(41) "How to use it" _n
  43. _col(9) _dup(16) "-" _col(41) _dup(31) "-" _n
  44. in ye _col(9) "auto.dta" _col(41) in wh "use %path`auto, clear" _n
  45. in ye _col(9) "census.dta" _col(41) in wh "use %path`census, clear" _n
  46. in ye _col(9) "hsng.dta" _col(41) in wh "use %path`hsng, clear" _n(2)
  47. in ye _col(9) "kva.dta" _col(41) in wh "use %path`kva, clear" _n
  48. in ye _col(9) "cancer.dta" _col(41) in wh "use %path`cancer, clear" _n(2)
  49. in ye _col(9) "systolic.dta" _col(41) in wh "use %path`systolic, clear" _n
  50. in ye _col(9) "sysage.dta" _col(41) in wh "use %path`sysage, clear" _n(2)
  51. in gr
  52. "Feel free to experiment with them." _n ;
  53. set more 0 ; more ; set more 1 ;
  54.  
  55. di _n(2) in wh
  56. "auto.dta" _n
  57. "--------" _n ;
  58.  
  59. di _n in wh _dup(79) "-" _n in gr
  60. "To load the automobile data, you type:" _n
  61. in wh _dup(79) "-" _n(3)
  62. ". use %path`auto, clear" ;
  63. noisily use %path`auto, clear ;
  64.  
  65. di _n(2) in wh _dup(79) "-" _n in gr
  66. "This data originally came from Consumer Reports, April 1979, and from the" _n
  67. "United States Government EPA statistics on fuel consumption.  It was com-" _n
  68. "piled and published in "
  69. in ye "Graphical Methods for Data Analysis" in gr ", The Wadsworth" _n
  70. "Statistics/Probability Series, 1983." _n(2)
  71. "You can discover the contents of a data set by typing '"
  72. in wh "describe" in gr "':" _n
  73. in wh _dup(79) "-" _n(2)
  74. ". describe" ;
  75. set more 0 ; more ; set more 1 ;
  76. noisily describe ;
  77. di _n in wh _dup(79) "-" _n in gr
  78. "The automobile data contains information on 74 cars.  You should be able to" _n
  79. "figure out the data based on the description." _n
  80. in wh _dup(79) "-" _n ;
  81. set more 0 ; more ; set more 1 ;
  82. di _n(2) in wh _dup(79) "-" _n in gr
  83. "Another good way to learn about a data set is to '"
  84. in wh "summarize" in gr "' it.  When you type" _n
  85. "'" in wh "summarize" in gr
  86. "' without arguments, all the variables are summarized:" _n
  87. in wh _dup(79) "-" _n(3)
  88. ". summarize" ;
  89. noisily summarize ;
  90. di ; set more 0 ; more ; set more 1 ;
  91. di in wh _dup(79) "-" _n in gr
  92. "There are zero observations on make because it is a string variable.  There"
  93. _n
  94. "are 69 observations on rep78 because there are some missing values." _n
  95. in wh _dup(79) "-" _n ;
  96. set more 0 ; more ; set more 1 ;
  97.  
  98. di _n(2) in wh _dup(79) "-" _n in gr
  99. "You can learn more about categorical variables by tabulating them.  Compare" _n
  100. in wh "tabulate" in gr " with " in wh "summarize" in gr ":" _n
  101. in wh _dup(79) "-" _n(2)
  102. ". summarize rep78" ;
  103. noisily summarize rep78 ;
  104. di _n in wh ". tabulate rep78" ;
  105. noisily tabulate rep78 ;
  106. set more 0 ; more ; set more 1 ;
  107.  
  108. di _n(2) in wh _dup(79) "-" _n in gr
  109. "Next on our list is the Census data:" _n
  110. in wh _dup(79) "-" _n(2)
  111. ". use %path`census, clear" ;
  112. noisily use %path`census, clear ;
  113. di _n in wh ". describe" ;
  114. noisily describe ;
  115. set more 0 ; more ; set more 1 ;
  116. di _n(2) in wh _dup(79) "-" _n in gr
  117. "Again, we learn more about the data by summarizing it:" _n
  118. in wh _dup(79) "-" _n(2)
  119. ". summarize" ;
  120. noisily summarize ;
  121. di _n in wh _dup(79) "-" _n in gr
  122. "There are zero observations on state because it is a string variable." _n
  123. in wh _dup(79) "-" ;
  124. set more 0 ; more ; set more 1 ;
  125.  
  126. di _n(15) in wh _dup(79) "-" _n in gr
  127. "Now let's look at " in ye "hsng.dta" in gr
  128. ".  It also contains 1980 Census data on the 50" _n
  129. "states, only this data concerns the value and cost of housing." _n
  130. in wh _dup(79) "-" _n(2)
  131. ". use %path`hsng, clear" ;
  132. noisily use %path`hsng, clear ;
  133. di _n in wh ". describe" ;
  134. set more 0 ; more ; set more 1 ;
  135. noisily describe ;
  136. di _n ; set more 0 ; more ; set more 1 ;
  137.  
  138. di _n(2) in wh _dup(79) "-" _n in ye
  139. "kva.dta" in gr
  140. " contains failure time for a fictional experiment with generators.  We" _n
  141. "used this data in our tutorial on survival analysis:" _n
  142. in wh _dup(79) "-" _n(3)
  143. ". use %path`kva, clear" ;
  144. noisily use %path`kva, clear ;
  145. di _n in wh ". describe" ;
  146. noisily describe ;
  147. di _n(2); set more 0 ; more ; set more 1 ;
  148.  
  149. di _n(2) in wh _dup(79) "-" _n in gr
  150. "We also used "
  151. in ye "cancer.dta" in gr " in our survival analysis tutorial.  It contains fic-"
  152. _n
  153. "tional data on a drug trial:" _n
  154. in wh _dup(79) "-" _n(2)
  155. ". use %path`cancer, clear" ;
  156. noisily use %path`cancer, clear ;
  157. di _n in wh ". describe" ;
  158. noisily describe ;
  159. di _n(2) ; set more 0 ; more ; set more 1 ;
  160.  
  161. di _n(2) in wh _dup(79) "-" _n in gr
  162. "We used " in ye "systolic.dta" in gr
  163. " in our tutorial on ANOVA.  This is one of the classic" _n
  164. "data sets for two-way analysis-of-variance designs.  It is from A. A. Affi" _n
  165. "and S. P. Azen, "
  166. in ye "Statistical Analysis:  A Computer-Oriented Approach" in gr ", Academic"
  167. _n
  168. "Press, 1972." _n
  169. in wh _dup(79) "-" _n(3)
  170. ". use %path`systolic, clear" ;
  171. noisily use %path`systolic, clear ;
  172. di _n in wh ". describe" ;
  173. noisily describe ;
  174. di _n(2) ; set more 0 ; more ; set more 1 ;
  175.  
  176. di _n(2) in wh _dup(79) "-" _n in ye
  177. "sysage.dta" in gr " is the same as " in ye "systolic.dta" in gr
  178. " except that it contains a fourth var-" _n
  179. "iable, age.  When we wrote the ANOVA tutorial, we needed a continuous variable"
  180. _n
  181. "to illustrate analysis of covariance.  The variable is not real data." _n
  182. in wh _dup(79) "-" _n(3)
  183. ". use %path`sysage, clear" ;
  184. noisily use %path`sysage, clear ;
  185. di _n in wh ". describe" ;
  186. noisily describe ;
  187. di _n(2) ; set more 0 ; more ; set more 1 ;
  188.  
  189. drop _all ;
  190. label drop _all ;
  191. macro define F6 "do %path`yourdata.tut;";
  192.  
  193. di _n(4) in white
  194. "Demonstration ends" _n
  195. "------------------" _n ;
  196.  
  197.  
  198. di in green
  199. "That concludes our short demonstration, but there's much more.  We now return"
  200. _n
  201. "control to you.  Some suggestions:" _n ;
  202.  
  203. di in green
  204. "If you ..." _col(34) "Then we will show you ..." _n
  205. "    Press " in white "F5" in green _col(38) "a table of tutorial contents" _n
  206. "    Press " in white "F6" in green _col(38) "the next tutorial, "
  207. in white "yourdata.tut" _n ;
  208.  
  209. run %path`tobuy.tut ;
  210.